<template>
    <div>
        <h2>
            childtwo  - 2 
        </h2>
        <button @click="changeparent">$parent 修改父组件 </button>
        <button @click="changeCount(1000)">反向props  修改父组件 </button>
        <button @click="changemyself">自定义事件 </button>
        <h2>n === {{ n }} </h2>
        <slot></slot>
        <p>
            <input type="text" :value="value"  @input="$emit('input',$event.target.value)">
        </p>
        <hr>
    </div>
</template>

<script>
export default {
    props:['changeCount','value'],

    data(){
        return {
            n:1000
        }
    },
    methods:{
        changeparent(){
            this.$parent.msg = "hello world ";
            this.$parent.changeShow()
        },
        changemyself(){
            this.$emit("changemyself",'国庆快乐....');
        }
    },
    mounted(){
        this.$bus.$on("changeTwoxxxx",n=>{
            this.n += n;
        })
    }
}
</script>